// 成功申请

import icon from '@/assets/success_icon.png';
import { jumpUrl } from '@/utils';
import { Button, Col, Modal, Space } from 'antd';
import { useIntl, useLocation } from 'umi';
import './index.less';
type Props = {
  visible: boolean;
  handleCancel: () => void;
  data: Partial<Center.ProductList>;
};
const ApplySucModal: React.FC<Props> = ({ visible, handleCancel }) => {
  const intl = useIntl();
  const location = useLocation();

  return (
    <Modal
      className="apply_succes_modal"
      onCancel={handleCancel}
      footer={false}
      width={647}
      closable={false}
      open={visible}
      destroyOnClose
      styles={{
        content: {
          padding: '0 0 45px 0',
        },
      }}
    >
      <Col style={{ textAlign: 'center' }}>
        {/* <div className="apply_succes_modal_bg" /> */}
        <img src={icon} width={100} height={100} style={{ margin: '59px 0 24px 0' }} />
        <div style={{ padding: '2px 90px 0' }}>
          <div style={{ fontSize: 28, fontWeight: 700, color: '#333', marginBottom: 24 }}>
            <div>{intl.formatMessage({ id: 'home.congratulations' })}</div>
            <div>{intl.formatMessage({ id: 'home.apply_suc' })}</div>
            <div style={{ fontSize: 16, textAlign: 'left', marginTop: 20, lineHeight: '25px' }}>
              {intl.formatMessage({ id: 'home.contact_you' })}
            </div>
          </div>

          <Space size={67}>
            <Button
              type="primary"
              onClick={() => {
                handleCancel();
                if (location.pathname.replace('/en', '') != '/product') {
                  jumpUrl('/product');
                }
              }}
              style={{ minWidth: 200, height: 60 }}
            >
              {intl.formatMessage({ id: 'home.goon' })}
            </Button>
            <Button
              type="primary"
              onClick={() => {
                jumpUrl('/center?index=0');
              }}
              style={{ minWidth: 200, height: 60 }}
            >
              {intl.formatMessage({ id: 'home.chekc_history' })}
            </Button>
          </Space>
        </div>
      </Col>
    </Modal>
  );
};

export default ApplySucModal;
